﻿@{ Layout = "../../Views/Shared/_LayoutPhone.cshtml";}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<body>
    <header style="width: 100%; height: 4rem; background-color: rgb(255,135,0);top:0px;position: fixed;z-index: 1;">
        <a href="#" onclick="tiaoye()">
            <img src="~/GoTRI/img/left.png" alt="" style="float: left;
            width: 1rem;
            height: 2rem;
            margin-left: 1rem;
            margin-top: 1rem;
            position:absolute;
	        left:0px;
	        top:0px;
	        z-index:1;">
        </a>
        <div style=" width: 100%; height: 4rem; line-height: 4rem; text-align: center; color: #fff; font-size: 1.3rem;">楼房管理</div>
    </header>
    <div style="width:1px;padding-bottom:50px"></div>
    <script>
        $(".yi").attr("hidden", "");
    </script>
    <table style="width: 100%; text-align: center;" border="1" cellspacing="0">
        <tbody>
            <tr>
                <td colspan="5" style="text-align:center;"><label id="xiaoqumingcheng" style="font-weight:bold;"></label></td>
            </tr>
            <tr>
                <td rowspan="2">房屋状态</td>
                <td>总户数</td>
                <td style="background-color:red;color:black">已出售</td>
                <td style="background-color:gray;color:black">未出售</td>
                <td style="background-color:green;color:black">审核中</td>
            </tr>
            <tr>
                <td>
                    <label id="zoushu"></label>
                </td>
                <td>
                    <label id="chushou"></label>
                </td>
                <td>
                    <label id="weichushou"></label>
                </td>
                <td>
                    <label id="shenhezhong"></label>
                </td>
            </tr>
        </tbody>
    </table>
    <div style="width: 100%; margin: 20px,1px,1px,1px; background-color: antiquewhite;text-align: center;">
        <div style="float:left;width:10%;margin: 3px 3px 3px 3px;" id="louchengshu">
        </div>
        <div style="overflow-y: scroll; overflow-x: scroll;float:left;width:88%;margin: 3px 0px 3px 0px;" id="fangwshujuzhanshibangding">

        </div>

    </div>
    <div style="margin-bottom: 70px;"></div>
    <input type="text" hidden="hidden" id="louhao" />
    <input type="text" hidden="hidden" id="xiaoquid" />
</body>
<script>
    $(document).ready(function () {
        var louhao = getQuery("louhao");
        $("#louhao").val(louhao);
        var xiaoquid = getQuery("xiaoqu");
        $("#xiaoquid").val(xiaoquid);
        ChaKan();
        XiaoQulouchengshu();
        fangwuzhanshi();
    });

    function tiaoye() {
        location.href = "FangYuanXiangXi?id=" + getQuery("xiaoqu");
    }

    function XiaoQulouchengshu() {
        var xiaoqu = $("#xiaoquid").val();
        var louhao = $("#louhao").val();
        $.ajax({
            type: 'post',
            url: '../PhoneFangYuan/Getcengshu',
            async: false,
            dataType: 'text',
            data: { xiaoqu: xiaoqu, louhao: louhao },
            success: function (date) {
                $("#louchengshu").html(date);
            },
        })

    }

    function fangwuzhanshi() {
        var xiaoqu = $("#xiaoquid").val();
        var louhao = $("#louhao").val();
        $.ajax({
            type: 'post',
            url: '../PhoneFangYuan/ChaKanXianShi',
            async: false,
            dataType: 'text',
            data: { xiaoqu: xiaoqu, louhao: louhao },
            success: function (date) {
                $("#fangwshujuzhanshibangding").html(date);
            },
        })

    }

    function ChaKan() {
        var xiaoqu = $("#xiaoquid").val();
        var louhao = $("#louhao").val();
        if (xiaoqu == "0") {
            alert("请选择小区");
        } else if (louhao == "0") {
            alert("请选择楼号");
        } else {
            $.ajax({
                type: 'post',
                url: '../PhoneFangYuan/ChaKanFangWuShu',
                async: false,
                dataType: 'json',
                data: { xiaoqu: xiaoqu, louhao: louhao },
                success: function (date) {
                    $(date).each(function (key) {
                        $("#xiaoqumingcheng").text(date[key].xiaoqumingcheng);
                        $("#zoushu").text(date[key].zoushu);
                        $("#chushou").text(date[key].chushou);
                        $("#weichushou").text(date[key].weichushou);
                        $("#shenhezhong").text(date[key].shenhezhong);
                    })
                },
            });

            $.ajax({
                type: 'post',
                url: '../PhoneFangYuan/ChaKanXianShi',
                async: false,
                dataType: 'text',
                data: { xiaoqu: xiaoqu, louhao: louhao },
                success: function (date) {
                    $("#div_DanYuan").html(date);
                },
            })
        }
    }

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }
    function tiao() {
        location.html = "FangYuanXiangXi?id=" + $("#xiaoquid").val();
    }
</script>
